import { Injectable } from '@angular/core';
import { HttpService } from './HttpService';


@Injectable()
export class ApiService
{
    public constructor(
      private httpService: HttpService,
    ) {}
    /**
     * 登录
     * @param body
     * @param callback
     */
    public login(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/login_check',
        body,
        callback
      )
    }
    /**
     * 获取任务列表
     * @param body
     * @param callback
     */
    public getTaskLists(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/tasklist_ajax',
        body,
        callback
      )
    }
    /**
     * 获取任务列表
     * @param body
     * @param callback
     */
    public getTaskStatusLists(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/tasklist_ajax_new',
        body,
        callback
      )
    }
    /**
     * 获取任务详情
     * @param body
     * @param callback
     */
    public getTaskDetails(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/taskcontent',
        body,
        callback
      )
    }
    /**
     * 添加任务
     * @param body
     * @param callback
     */
    public addTasks(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/createtask',
        body,
        callback
      )
    }
    /**
     * 添加任务
     * @param body
     * @param callbackhttp://localhost/td/index.php/Home/Index/taskaction
     */
    public getUsers(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/getusers',
        body,
        callback
      )
    }
    /**
     * 任务操作
     * @param body
     * @param callback
     */
    public taskOperations(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/taskaction',
        body,
        callback
      )
    }
    /**
     * 上传图片
     * @param body
     * @param callback
     */
    public uploadImgs(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/upload',
        body,
        callback
      )
    }
    /**
     * 获取项目类型
     * @param body
     * @param
     */
    public getProjectTypes(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/getproject',
        body,
        callback
      )
    }
    /**
     * 获取任务类型
     * @param body
     * @param
     */
    public getTaskTypes(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/gettype',
        body,
        callback
      )
    }
    /**
     * 筛选任务内容
     * @param body
     * @param
     */
    public filterItems(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/search',
        body,
        callback
      )
    }
    /**
     * 任务修改
     * @param body
     * @param
     */
    public taskModify(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/taskedit',
        body,
        callback
      )
    }
    /**
     * 获取状态列表
     * @param body
     * @param
     */
    public getStatus(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/getdisplay',
        body,
        callback
      )
    }
    /**
     * 修改密码
     * @param body
     * @parammodifyPassword
     */
    public modifyPasswords(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/editpassword',
        body,
        callback
      )
    }
    /**
     * 任务提醒
     * @param body
     * @parammodifyPassword
     */
    public remindTasks(body = { }, callback = res => { console.log(res) })
    {
      this.httpService.post(
        'http://td.voc111.com/index.php/Home/Index/taskremind',
        body,
        callback
      )
    }

}
